<?php 
	include_once("../DbHandler/DataProvider.php");
	include_once("../DbHandler/DBConsts.php");
?>
<?php
class ClientController{
	/**
	 * insert client's information into database.
	 * @param unknown $email,$fullname,$delivery,$phoneNumber
	 * @return NULL|multitype:
	 */
	public static function insertNewClient($email, $fullname, $delivery, $phoneNumber){
		if($email == null || $fullname == null || $delivery == null || $phoneNumber == null)
			return null;
		$strSQL = "INSERT INTO `client` (`email`, `fullname`,`delivery`, `phonenumber`) 
				VALUES('".$email."','".$fullname."', '".$delivery."', '".$phoneNumber."')";
		
		$cn = DataProvider::Open();
		DataProvider::MoreQuery ($strSQL,$cn);
		
		if(mysqli_affected_rows($cn) == 0)
			$result=false;
		DataProvider::Close ($cn);
		return true;
	}
	
}
?>